#include <iostream>
using namespace std;

int main()
{
    //获取用户输入的电话号码
    long pnum = 13320218299;
    cin>>pnum;
    //获得11号码并保存到数组中
    int index[11]={};
    for(int i = 10; i>=0; i--)
    {
        index[i] = -1;
        index[i] = pnum % 10;
        pnum = pnum / 10;
    }    
    //选出号码中的数字，组成arr数组,注意不能重复
    int arr[10];
    int arrLen = 0;
    for(int i = 0; i<11; i++)
    {
        if(index[i]>=0)
        {
            bool bIfRepeat = false;
            for(int j =0; j<arrLen; j++)
            {
                if(arr[j] == index[i])
                {
                    bIfRepeat = true;
                    break;
                }
            }
            if(!bIfRepeat){
                arr[arrLen] = index[i];
                arrLen = arrLen + 1;
            }
        }            
    }
    //对arr数组冒泡排序
    while(true)
    {
        bool bIfSwap = false;
        for(int i = 0; i<arrLen-1; i++)
        {
            if(arr[i]<arr[i+1])
            {
                bIfSwap = true;
                int tmp = arr[i];
                arr[i] = arr[i+1];
                arr[i+1] = tmp;
            }
        }
        if(!bIfSwap)
            break;
    }
    //修改index中位置
    for(int i = 0; i<11; i++)
    {
        int j;
        for(j = 0; j<arrLen; j++)
            if(arr[j] == index[i])
               break;
        index[i] = j;
    }
     
    //输出结果

    char firstLine[] = "int[] arr = new int[]{";
    char secondLine[] = "int[] index = new int[]{";
    cout<<firstLine;
    int i;
    for(i = 0; i<arrLen-1; i++)
        cout<<arr[i]<<",";
    cout<<arr[i]<<"};"<<endl;
    cout<<secondLine;
    for(i = 0; i<11-1; i++)
        cout<<index[i]<<",";
    cout<<index[i]<<"};";
}